package kin.listener.system;

import java.io.File;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class TempFileManager implements Runnable {

	 //日志类
	// public Log log = LogFactory.getLog(getClass());
	 
	 //临时文件夹目录
	
	 
	 private String folderName;
	 private final static int MINUTE = 1000 * 60;
	 private final static int SLEEP_TIME = MINUTE * 60;
	 
	private  boolean isStop = false; //标示是否停止
	
	 
	 public void run() {
	  try{
		  
	   File file = new File(folderName);
	   
	   //1分钟
	   while(!isStop) {
	    deleteFile(file);
	    
	    //休息30分钟
	    Thread.sleep(SLEEP_TIME);
	    if(isStop==true){
	    	break;
	    }
	    
	   }
	   
	  }catch (Exception e) {
	   //log.error("删除文件失败！" + e);
	   e.printStackTrace();
	  }
	  
	 }
	 
	 public void stop(){
		 isStop=true;
	 }
	 
	 public void start(){
		// TempFileManager t=new TempFileManager("");
	 }

	private void deleteFile(File file) {
	
		
	}
	
	private static  boolean isTempFile(File file){
		
		return true;
		
	}
	
}